package main

import (
	//"github.com/robfig/cron"
	"fmt"
	"time"
)

var count int64 = 0
func main() {
	startTick()
	select {

	}
/*	c := cron.New()
	count := 0
	c.AddFunc("@every 10ms", func() {
		count ++
		fmt.Println(count)
	})
	c.Start()
	select {

	}*/
}
func startTick(){
	c := time.NewTicker(time.Millisecond * 10)
	go test(c)
}

func test(ticker *time.Ticker){

	for t:= range ticker.C{
		count ++
		fmt.Println("tick at",t)
		fmt.Println(count)
		if count == 1000{
			ticker.Stop()

			count = 0
			//time.Sleep(time.Second * 10)

			//startTick()
		}
	}
	fmt.Println("here")
}